import request from '@/util/request'

export function listMainAccount(index, size, params) {
  return request({
    url: `aqs/mainAccount/list/${index}/${size}.json`,
    method: 'get',
    params: params,
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

export function getUserRelate(id) {
  return request({
    url: `aqs/mainAccount/getUserRelate/${id}.json`,
    method: 'get',
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

export function updateMAcount(data) {
  return request({
    url: 'aqs/mainAccount/updateMAcount.json',
    method: 'put',
    data: data,
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

// 子账户解除主账户关系
export function cancelRelationship(data) {
  return request({
    url: 'aqs/mainAccount/cancelRelationship.json',
    method: 'put',
    data: data,
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

// 删除主账号
export function deleteMA(id) {
  return request({
    url: `aqs/mainAccount/${id}.json`,
    method: 'delete',
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

// 子账号审核主账号
export function audit(data) {
  return request({
    url: 'aqs/mainAccount/audit.json',
    method: 'put',
    data: data,
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}

// 子账号审核主账号
export function getAuditCount() {
  return request({
    url: 'aqs/mainAccount/getAuditCount.json',
    method: 'get',
    baseURL: process.env.VUE_APP_AJS_OTHER
  })
}
